import React from 'react';
import { useState } from "react"
import routes from './router';
import {Link,useRoutes} from 'react-router-dom'

const App = function (){
    const [counter,setCounter] = useState(100)
    return (
        <div style={{border:'1px solid red'}}>
            <h2>App</h2>
            <div>{counter}</div>
            <button onClick={()=>{setCounter(counter + 1)}}>+1</button>
            <div>
                <Link to='/'>
                    <button>Home</button>
                </Link>
                <Link to='/about'>
                    <button>About</button>
                </Link>
            </div>
            {/* 页面的占位 */}
            {useRoutes(routes)}
        </div>
    )
}

export default App;